#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
#url ='http://www.baidu.com'
url ="http://httpbin.org/get"
headers={
"Accept":"*/*",
"Accept-Encoding":'gzip, deflate, br',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3314.0 Safari/537.36 SE 2.X MetaSr 1.0'
}

#查询字符串
params ={'name':'mhz','age':'23'}

r=requests.get(url=url,headers=headers)
r.encoding ='utf-8'
#print(r.status_code)
#print(r.content.decode('gbk'))

#print r.status_code  # 获取响应状态码
print r.content  # 获取响应消息
#print(r.text)